package com.wxprogram.smallprogram.entity.utilEntity;

import java.util.List;

public class PageUtil<T> {
	private int current;//当前页
	private int size = 10;
	private int count;//总容量
	private int total;//总页数
	private List<T> list;
	private int offset;//索引

	public PageUtil(int current) {
		this.current = current;
		this.offset = (current - 1) * size;
	}
	public PageUtil(){
		
	}
	public int getCurrent() {
		return current;
	}

	public void setCurrent(int current) {
		this.current = current;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
		this.total = count / size + ((count % size) > 0 ? 1 : 0);
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public int getOffset() {
		return offset;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

}
